import { ss } from '@/utils/storage'
import {hasToken} from "@/api";

const LOCAL_NAME = 'SECRET_TOKEN'

export function getToken() {
  return localStorage.getItem('token')
}

export async function checkToken(token: string){
	const param = {
		'token': token
	}
	const {data} = await hasToken(param)
	return data.token
}

export function setToken(token: string) {
  return ss.set(LOCAL_NAME, token)
}

export function removeToken() {
  return ss.remove(LOCAL_NAME)
}
